using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

public class ConfirmBox : MonoBehaviour
{
    public TMP_Text text;
    public Button btn;



    public void Show(string message, UnityAction action)
    {
        btn.onClick.RemoveAllListeners();
        btn.onClick.AddListener(() => gameObject.SetActive(false));
        gameObject.SetActive(true);
        text.text = message;
        btn.onClick.AddListener(action);
    }
}
